/**
 *
 */
package com.zhuoyue.elmt.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.eit.eitsite.common.persistence.Page;
import com.eit.eitsite.common.service.CrudService;
import com.zhuoyue.elmt.entity.WbMainPlan;
import com.zhuoyue.elmt.dao.WbMainPlanDao;

/**
 * 维保计划Service
 *
 * @author JiangYH
 * @version 2017-04-17
 */
@Service
@Transactional(readOnly = true)
public class WbMainPlanService extends CrudService<WbMainPlanDao, WbMainPlan> {

    public WbMainPlan get(String id) {
        return super.get(id);
    }

    public List<WbMainPlan> findList(WbMainPlan wbMainPlan) {
        return super.findList(wbMainPlan);
    }

    public Page<WbMainPlan> findPage(Page<WbMainPlan> page, WbMainPlan wbMainPlan) {
        return super.findPage(page, wbMainPlan);
    }

    @Transactional(readOnly = false)
    public void save(WbMainPlan wbMainPlan) {
        super.save(wbMainPlan);
    }

    @Transactional(readOnly = false)
    public void delete(WbMainPlan wbMainPlan) {
        super.delete(wbMainPlan);
    }

    @Transactional(readOnly = false)
    public void saveList(WbMainPlan wbMainPlan, List<WbMainPlan> wbMainPlanList) {
        // 删掉重新加
        dao.deleteBySbzcdmAndContractNo(wbMainPlan);
        for (WbMainPlan saveWbMainPlan : wbMainPlanList) {
            saveWbMainPlan.preInsert();
            dao.insert(saveWbMainPlan);
        }
    }

}